/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : global.h
  * @brief          : Global include header file
  *                   This file contains the common defines of the application.
  * @author         : Qilong Huang <jcdiyhelp@qq.com>
  * @date           : 2021-06-08 
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2021 Joy create tech(Suzhou, China) Co., Ltd.
  * All rights reserved.
  *
  *
  ******************************************************************************
  */
 /* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __GLOBAL_H
#define __GLOBAL_H

#ifdef __cplusplus
extern "C" {
#endif

/* Global include ---------------------------------------------------------*/
#include "usart.h"
#include "type.h"
#include "func.h"
#include "rcc.h"
#include "i_eeprom.h"
#include "flash.h"




/*================================================[ public defines   ]================================================*/
/*Flash key definition*/
#define PEKEY1                                  0x89ABCDEFUL
#define PEKEY2                                  0x02030405UL

/*APP Address definition*/
#define BootSWAddress                           0x8000000
#define AppSWAddress                            0x8002800UL
#define AppMaxLen                               0x6000
#define BackMaxLen                              0x6000
#define BackupSWAddress                         0x8008800
#define BootBISAddress                          0x80001AC
#define AppBISAddress                           0x8008780
#define BackBISAddress                          0x800E780
#define FlashVaildLen                           0xC000

/*APP internal EEPROM definition*/
#define I_EEPROM_BASE_ADDR                      0x8080000
#define I_EEPROM_MAX_LEN                        4096

#define WORD_LEN                                4


#define FLASH_HALFPAGE_LEN                      32
  

#ifdef __cplusplus
}
#endif

#endif /* __GLOBAL_H */